<?php
declare (strict_types = 1);

namespace app\command;

use app\api\service\CommonService;
use think\console\Command;
use think\console\Input;
use think\console\input\Argument;
use think\console\input\Option;
use think\console\Output;
use think\facade\Db;

class SendDingOrder extends Command
{
    protected function configure()
    {
        // 指令配置
        $this->setName('send_ding_order')
            ->setDescription('电商系统订单扫描');
    }

    protected function execute(Input $input, Output $output)
    {
        $connect = Db::connect('goods');
        // 指令输出
       $data =  $connect->name('ewei_shop_order')->where(['status'=>1,'paytype'=>21])->select()->toArray();
        $comm = new CommonService();
        $message = "========================\r".
            "   未发货订单数量:".count($data)."\r".
            "   请及时处理!\r".
            "--------------------------\r";

            $message.="========================";
        $comm->send_text_msg('wxid_xmyit5wjvewv22','18040967501@chatroom',$message);
    }
}
